import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/Index.vue'
import Login from '../views/Login.vue'
import Categroy from '../views/Categroy.vue'
import Echart from '../views/Echart.vue'
import Product from '../views/Product.vue'
import Attribute from '../views/Attribute.vue'
import Users from '../views/Users.vue'
import Order from '../views/Order.vue'
import Orderdetail from '../views/Orderdetail.vue'
import Permission from '../views/Permission.vue'
import Categoryson from '../views/Categoryson.vue'
import Productdetail from '../views/Productdetail.vue'
import Addproduct from '../views/Addproduct.vue'
import Updateproduct from '../views/Updateproduct.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/index',
    name: 'Index',
    children: [
      {
        path: 'categroy', component: Categroy
      },
      {
        path: 'echart', component: Echart
      },
      {
        path: 'addproduct', component: Addproduct
      },
      {
        path: 'updateproduct', component: Updateproduct
      },
      {
        path: 'users', component: Users
      },
      {
        path: 'attribute', component: Attribute
      },
      {
        path: 'permission', component: Permission
      },
      {
        path: 'categoryson', component: Categoryson
      },
      {
        path: 'productdetail', component: Productdetail
      },
      
      {
        path: 'product', component: Product
      },
      {
        path: 'order',
         component: Order
      },
      {
        path: 'orderdetail', component: Orderdetail
      }
    ],
    component: Index
  },
  {
    path: '/',
    name: 'Login',
    component: Login
  },
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
